//
//  NoImageTableViewCell.m
//  VEW
//
//  Created by lanou3g on 15/7/22.
//  Copyright (c) 2015年 Y团. All rights reserved.
//

#import "NoImageTableViewCell.h"

@implementation NoImageTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setupView];
    }
    return self;
}

-(void)setupView {
    
    // 标题
    _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, self.frame.size.width-20, 35)];
    //    _titleLabel.backgroundColor = [UIColor orangeColor];
    _titleLabel.numberOfLines = 0;
    _titleLabel.font = [UIFont fontWithName:@"Baskerville-SemiBold" size:16];
    [self.contentView addSubview:_titleLabel];
    // 时间;
    _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.titleLabel.frame)+10, CGRectGetWidth(self.titleLabel.frame)-100, 16)];
    //    _nameLabel.backgroundColor = [UIColor purpleColor];
    _timeLabel.numberOfLines = 0;
    _timeLabel.font = [UIFont systemFontOfSize:15];
    [self.contentView addSubview:_timeLabel];
    // 评论数量
    _commentLabel =[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth([[UIScreen mainScreen]bounds])-70, CGRectGetMaxY(self.titleLabel.frame)+10, 60, 16)];
    //    _commentLabel.backgroundColor = [UIColor purpleColor];
    _commentLabel.font = [UIFont systemFontOfSize:15];
    [self.contentView addSubview:_commentLabel];
}
// 定义一个计算字符串高度的方法
+(CGFloat)stringHeight:(NSString *)string {
    // 设置字符串的属性
    NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:17]};
    // 计算字符串的区域
    CGRect rect = [string boundingRectWithSize:CGSizeMake(200, 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    
    return rect.size.height;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
